<%@page import="cn.edu.thsis.pojo.User"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="cn.edu.thsis.dao.impl.jdbcUtils"%>
<%@page import="java.sql.Connection"%>
<%@page import="cn.edu.thsis.pojo.thsis"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>毕业论文选题系统-论文动态</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/font-awesome.css">
    <link rel="stylesheet" href="../css/animate.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
<%
User user = (User)request.getSession().getAttribute("user");
Connection conn = jdbcUtils.getConnection();
String sql = "SELECT warn FROM teacher WHERE uid =?";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, user.getUid());
ResultSet rst = ps.executeQuery();
while(rst.next()){
	Integer warn = rst.getInt("warn");
	if(warn.equals(2)){%>
    	<div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>警告</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="panel panel-warning">
                                <div class="panel-heading">
                                    <i class="fa fa-warning"></i> 请尽快完成出题操作</div>
                                <div class="panel-body">
                                    <p>请尽快完成选题操作，如不能按时完成，将严重影响学生们毕业论文（设计）的开展！</p>
                                </div>
                            </div>
                        </div>
                    </div> 
                </div>
            </div>
        </div>
    </div>
    	<%}}%>
    	<%
    	Connection conn2 = jdbcUtils.getConnection();
    	String sql2 = "SELECT sid,mid,wtime FROM mess WHERE tid = ?";
    	PreparedStatement pst = conn2.prepareStatement(sql2);
    	pst.setString(1, user.getUid());
    	ResultSet rs = pst.executeQuery();
    	while(rs.next()){
    	%><div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>留言</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <i class="fa fa-warning"></i>留言人：<%=rs.getString("sid")%></div>
                                <div class="panel-body">
                                    <p>内容：<%=rs.getString("mid")%></p>
                                </div>
                                <div class="panel-footer">留言时间：<%=rs.getDate("wtime")%></div>
                            </div>
                        </div>
                    </div> 
                </div>
            </div>
        </div>
    </div>
    	<%} %>
</div>
<!-- 全局js -->
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>

<!-- 自定义js -->
<script src="../js/content.js"></script>
</body>
</html>